home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / dev / src / wangisrc.lha / wangi / z / wpad_library / wpad.h < prev    next >
C/C++ Source or Header  |  1995-08-28  |  9KB  |  308 lines

  1. #ifndef LIBRARIES_WPAD_H
  2. #define LIBRARIES_WPAD_H
  3.  
  4. /***************************************************************************
  5.  * wpad.h
  6.  *
  7.  * wpad.library, Copyright ©1995 Lee Kindness.
  8.  *
  9.  * 
  10.  */
  11.  
  12. #ifndef EXEC_TYPES_H
  13. #include <exec/types.h>
  14. #endif
  15. #ifndef EXEC_NODES_H
  16. #include <exec/nodes.h>
  17. #endif
  18. #ifndef UTILITY_TAGITEM_H
  19. #include <utility/tagitem.h>
  20. #endif
  21. #ifndef LIBRARIES_COMMODITIES_H
  22. #include <libraries/commodities.h>
  23. #endif
  24. #ifndef INTUITION_CLASSUSR_H
  25. #include <intuition/classusr.h>
  26. #endif
  27.  
  28. /***************************************************************************
  29.  * Library name and version
  30.  */
  31.  
  32. #define WPADNAME "wpad.library"
  33. #define WPADVERSION 1
  34.  
  35. /***************************************************************************
  36.  * Pad structure - The major handle in wpad.library
  37.  */
  38.  
  39. #ifndef WPAD_C
  40. struct Pad 
  41. {
  42.     LONG pad_ID;
  43.     /* Private fields follow... */
  44. };
  45. #endif
  46.  
  47. /**************************************************************************
  48.  * Tags for WP_OpenPad(), WP_SetPadAttrs(), WP_GetPadAttrs()
  49.  *
  50.  * I - Can use with WP_OpenPadA()
  51.  * S - Can use with WP_SetPadAttrsA()
  52.  * G - Can use with WP_GetPadAttrsA()
  53.  *
  54.  * Default is for WP_OpenPad if tag is not specified
  55.  */
  56.  
  57. #define WP_TAGBASE (TAG_USER + 0x2000)
  58.  
  59. #define WPOP_ProcName      (WP_TAGBASE +  1)
  60.         /* (I-G) (STRPTR)
  61.          * Name of the created process/thread
  62.          * Default - "wpad.library_Pad"
  63.          */
  64. #define WPOP_StackSize     (WP_TAGBASE +  2)
  65.         /* (I-G) (LONG)
  66.          * Stack size of the created thread
  67.          * Default - 4096 
  68.          */
  69. #define WPOP_Priority      (WP_TAGBASE +  3)
  70.         /* (ISG) (LONG)
  71.          * Priority of the created thread
  72.          * Default - 0
  73.          */
  74. #define WPOP_CurrentDir    (WP_TAGBASE +  4)
  75.         /* (---) 
  76.          * Not implemented 
  77.          */
  78. #define WPOP_LeftEdge      (WP_TAGBASE +  5)
  79.         /* (ISG) (LONG)
  80.          * Left edge of pad 
  81.          * See WPOP_LEFTEDGE_#? defines for other options
  82.          * Default - 0
  83.          */
  84. #define WPOP_TopEdge       (WP_TAGBASE +  6)
  85.         /* (ISG) (LONG)
  86.          * Top edge of pad
  87.          * See WPOP_TOPEDGE_#? defines for other options
  88.          * Default - 0 
  89.          */     
  90. #define WPOP_Width         (WP_TAGBASE +  7)
  91.         /* (ISG) (LONG)
  92.          * Width of pad
  93.          * Default - 60
  94.          */
  95. #define WPOP_Height        (WP_TAGBASE +  8)
  96.         /* (ISG) (LONG)
  97.          * Height of Pad
  98.          * Default - 120 
  99.          */
  100. #define WPOP_Items         (WP_TAGBASE +  9)
  101.         /* (ISG) (struct List *)
  102.          * List of items for the pad
  103.          * Tag must be given to WP_OpenPadA() 
  104.          */
  105. #define WPOP_Hook          (WP_TAGBASE + 10)
  106.         /* (ISG) (struct Hook *) Hook(A0 Hook *, A2 WPOPHookMsg *, A1 PadItem*)
  107.          * This hook will be called everytime an item is double clicked.
  108.          */
  109. // RESERVED (WP_TABBASE + 11)
  110. #define WPOP_Menu          (WP_TAGBASE + 12)
  111.         /* (IS-) (struct Menu *)
  112.          * Menu for pad
  113.          */
  114. #define WPOP_PubScreenName (WP_TAGBASE + 13)
  115.         /* (ISG) (STRPTR)
  116.          * Name of public screen to open on
  117.          * Default - default public screen
  118.          */
  119. #define WPOP_ScrollerWidth (WP_TAGBASE + 14)
  120.         /* (ISG) (LONG)
  121.          * Width of the scroller on the pad listview
  122.          * Default - 16
  123.          */
  124. #define WPOP_Flags         (WP_TAGBASE + 15)
  125.         /* (ISG) (ULONG)
  126.          * Determines the style of the pad. See WPOP_STYLE_#? defines.
  127.          * Default - WPOP_STYLE_SIZEGADGET | WPOP_STYLE_DRAGBAR | 
  128.          *           WPOP_STYLE_DEPTHGADGET | WPOP_STYLE_CLOSEGADGET
  129.          */
  130. #define WPOP_Title         (WP_TAGBASE + 16)
  131.         /* (ISG) (STRPTR)
  132.          * Title of the pad window (c.f. WA_Title)
  133.          * Default - ""
  134.          */
  135. #define WPOP_ScreenTitle   (WP_TAGBASE + 17)
  136.         /* (ISG) (STRPTR)
  137.          * Title of the pad screen (c.f. WA_ScreenTitle)
  138.          * Default - ""
  139.          */
  140. #define WPOP_Font          (WP_TAGBASE + 18)
  141.         /* (ISG) (struct TextAttr *)
  142.          * Default font for this pad. Each item can override this!
  143.          * Tag must be given to WP_OpenPadA()
  144.          */
  145. #define WPOP_Iconify       (WP_TAGBASE + 19)
  146.         /* (ISG) (LONG)
  147.          * Iconify method - See WPOP_ICONIFY_#? defines
  148.          * Default - WPOP_ICONIFY_HOTKEY
  149.          */
  150. #define WPOP_Broker        (WP_TAGBASE + 20)
  151.         /* (ISG) (CxObj *)
  152.          * Commodities broker to add hotkey onto
  153.          */
  154. #define WPOP_HotKey        (WP_TAGBASE + 21)
  155.         /* (ISG) (STRPTR)
  156.          * Input description of the event which will activate-hide-show
  157.          * the pad
  158.          */
  159. #define WPOP_IconifyIcon   (WP_TAGBASE + 22)
  160.         /* (ISG) (STRPTR)
  161.          * If WPOP_Iconify is WPOP_ICONIFY_APPICON then this is the filename
  162.          * of the icon to use (sans .info)
  163.          * Default - "ENV/Sys/def_Pad"
  164.          */
  165. #define WPOP_State         (WP_TAGBASE + 23)
  166.         /* (ISG) (LONG)
  167.          * State that the pad will open in... ie hidden/iconified or shown
  168.          * See WPOP_OPENSTATE_#? defines
  169.          * Default - WPOP_STATE_SHOWN
  170.          */
  171. #define WPOP_CNPTags       (WP_TAGBASE + 24)
  172.         /* (I--) (struct TagItem *)
  173.          * Optional Tags to pass straight to CreateNewProc() 
  174.          */
  175. #define WPOP_OWTTags       (WP_TAGBASE + 25)
  176.         /* (ISG) (struct TagItem *)
  177.          * Optional Tags to pass straight to OpenWindowTags() 
  178.          */
  179. #define WPOP_CGTags        (WP_TAGBASE + 26)
  180.         /* (ISG) (struct TagItem *)
  181.          * Optional Tags to pass straight to CreateGadget() for the listview
  182.          */
  183. #define WPOP_LMTags        (WP_TAGBASE + 27)
  184.         /* (ISG) (struct TagItem *)
  185.          * Optional tags to pass straight to LayoutMenuA()
  186.          */
  187.  
  188. /**************************************************************************
  189.  * Defines for WPOP_LeftEdge and WPOP_TopEdge
  190.  */
  191.  
  192. #define WPOP_LEFTEDGE_MOUSE -1 
  193.         /* Center on mouse pointer */
  194. #define WPOP_TOPEDGE_MOUSE -1
  195.         /* Center on mouse pointer */
  196. #define WPOP_TOPEDGE_TBORDER -2
  197.         /* Just under the menubar */
  198.  
  199. /**************************************************************************
  200.  * Defines for WPOP_Flags
  201.  */
  202.  
  203. #define WPOP_STYLE_SIZEGADGET  (1<<0)
  204.         /* include sizing system-gadget? */
  205. #define WPOP_STYLE_DRAGBAR     (1<<1)
  206.         /* include dragging system-gadget? */
  207. #define WPOP_STYLE_DEPTHGADGET (1<<2)
  208.         /* include depth arrangement gadget? */
  209. #define WPOP_STYLE_CLOSEGADGET (1<<3)
  210.         /* include close-box system-gadget? */
  211. #define WPOP_STYLE_BACKDROP    (1<<4)
  212.         /* this is a backdrop pad */
  213. #define WPOP_STYLE_BORDERLESS  (1<<5)
  214.         /* to get a pad sans border */
  215. #define WPOP_STYLE_ACTIVATE    (1<<6)
  216.         /* when pad opens, it's Active */
  217. #define WPOP_STYLE_STICKY      (1<<7)
  218.         /* When hidden it will reopen at last position */
  219.  
  220. /**************************************************************************
  221.  * Defines for WPOP_Iconify
  222.  */
  223.  
  224. #define WPOP_ICONIFY_HOTKEY  0 
  225.         /* Hotkey to iconify-deiconify */
  226. #define WPOP_ICONIFY_APPMENU 1 
  227.         /* Hotkey plus item in WB Tools menu */
  228. #define WPOP_ICONIFY_APPICON 2
  229.         /* Hotkey plus appicon on WB */
  230.  
  231. /**************************************************************************
  232.  * Defines for WPOP_State
  233.  */
  234.  
  235. #define WPOP_STATE_SHOWN  0
  236.         /* Pad will be shown */
  237. #define WPOP_STATE_HIDDEN 1
  238.         /* The pad will be iconified */
  239.  
  240. /***************************************************************************
  241.  * WPOPHookMsg structure
  242.  */
  243.  
  244. struct WPOPHookMsg
  245. {
  246.     ULONG hm_MethodID; /* ID see WPOP_HOOK_#? defines */
  247. };
  248.  
  249. /***************************************************************************
  250.  * defines for WPOPHookMsg.hm_MethodID
  251.  */
  252.  
  253. #define WPOP_HOOK_EXEC 1
  254.  
  255. /***************************************************************************
  256.  * Return codes from WPOP_Hook
  257.  */
  258.  
  259. #define WPOP_HOOKRETURN_OK 0
  260. #define WPOP_HOOKRETURN_FAIL 1
  261.  
  262. /***************************************************************************
  263.  * PIHandles structure
  264.  */
  265.  
  266. #ifndef WPAD_C
  267. struct PIHandles
  268. {
  269.     APTR pih_PRIVATE; /* All elements are private */
  270. };
  271. #endif
  272.  
  273. /***************************************************************************
  274.  * PadItem structure - One of these for each item in a pad
  275.  */
  276.  
  277. struct PadItem
  278. {
  279.     struct Node       pi_Node;           /* Backbone structure */
  280.     struct TextFont  *pi_Font;           /* Font to use for this item */
  281.     STRPTR            pi_HotKey;         /* Hotkey description */
  282.     STRPTR            pi_AppIconName;    /* Name of AppIcon (if to be used) */
  283.     STRPTR            pi_DataTypeName;   /* Name of gfx (if to be used) */
  284.     struct PIHandles *pi_Handles;        /* Private! */
  285.     /* You will probably extend this structure */
  286. };
  287.  
  288. #define pi_Name pi_Node.ln_Name  /* Name of item, text to display */
  289. #define pi_Flags pi_Node.ln_Type /* Flags, see PI_FLAGS_#? defines */
  290. #define pi_Colour pi_Node.ln_Pri /* Colour of text */
  291.  
  292. /***************************************************************************
  293.  * Flags for pi_Flags
  294.  */
  295.  
  296. #define PI_FLAGS_WBMENU        (1<<0)
  297.         /* Will have an entry on the Workbench Tools menu */
  298. #define PI_FLAGS_APPICON       (1<<1)
  299.         /* Will have an AppIcon on Workbench */
  300. #define PI_FLAGS_DATATYPE      (1<<2)
  301.         /* Will have a graphical item, using pi_DataTypeName */
  302. #define PI_FLAGS_DTTEXT        (1<<3)
  303.         /* As above plus overlayed text */
  304. #define PI_FLAGS_DEFTEXTCOLOUR (1<<3)
  305.         /* Ignore pi_Colour */
  306.  
  307. #endif    /* LIBRARIES_WPAD_H */
  308.